﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace XRERP.utils
{
    public class Tools
    {
        /// <summary>
        /// 获取GUID
        /// </summary>
        /// <returns>返回32位GUID</returns>
        public static String getGuid()
        {
            String guid = System.Guid.NewGuid().ToString().Replace("-","");
            return guid;
        }

        /// <summary>
        /// 转换为固定8位数字编码
        /// </summary>
        /// <param name="numb"></param>
        /// <returns></returns>
        public static String getNumber(String numb)
        {
            int i = numb.Length;
            int j = 8 - i;

            string tmp = "";

            for(int b=0;b<j;b++)
            {
                tmp = tmp + "0";
            }

            return tmp+numb;
        }
    }
}